<?php use_javascript('invoice')?>
<?php use_javascript('creditMemo')?>
<div class="module_title">Credit Memo</div>
<div id="creditMemoMenuBar" class="menu_bar">
  <?php echo link_to('New','invoice/search',array('class'=>'menu_unselected','id'=>'creditMemoMenuItemNew',))?>
  <?php echo link_to('Search','creditMemo/search',array('class'=>'menu_unselected','id'=>'creditMemoMenuItemSearch',))?>
</div>
<div id="<?php echo sfConfig::get('app_windows_main_id')?>" class="<?php echo sfConfig::get('app_windows_main_class')?>">
</div>


<script language="javascript">
  $(document).ready(
    function(){
      $('#creditMemoMenuItemNew').click(
        function(e){
          menuSelect("#creditMemoMenuBar",this);
          $.get(this.href,{},
            function(content){
              invoiceDialogMode=20;
              $("#ajMain").html(content);
            }
          );
          e.preventDefault();
        }
      );
      $('#creditMemoMenuItemSearch').click(
        function(e){
          menuSelect("#creditMemoMenuBar",this);
          $.get(this.href,{},
            function(content){
              $("#ajMain").html(content);
            }
          );
          e.preventDefault();
        }
      );
    }
  );
</script>